package com.demo.connectdbtest.module.common.util;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

/**
 * 描述：
 *
 * @author: chengc
 * @date 2021/04/07
 */
public class ExceptionUtil {
    //异常栈转为字符串
    public static String getStackMsg(Exception e) {
        ByteArrayOutputStream exception = new ByteArrayOutputStream();
        e.printStackTrace(new PrintStream(exception));
        return exception.toString();
    }
}
